package cn.iocoder.yudao.module.promotion.dal.mysql.updateorder;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.promotion.dal.dataobject.updateorder.UpdateOrderDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.promotion.controller.admin.updateorder.vo.*;

/**
 * 升级订单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UpdateOrderMapper extends BaseMapperX<UpdateOrderDO> {

    default PageResult<UpdateOrderDO> selectPage(UpdateOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UpdateOrderDO>()
                .likeIfPresent(UpdateOrderDO::getTitle, reqVO.getTitle())
                .likeIfPresent(UpdateOrderDO::getMemberName, reqVO.getMemberName())
                .likeIfPresent(UpdateOrderDO::getMemberMobile, reqVO.getMemberMobile())
                .eqIfPresent(UpdateOrderDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(UpdateOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UpdateOrderDO::getId));
    }

}